{% extends "piggy/base_generic.html" %}

{% block title %}
    <title> Add Plan - Piggy </title>
{% endblock %}

{% block content %}
<form action="{% url 'piggy:add_plan' %}" method="post">
{% csrf_token %}
<fieldset>
    <legend>Add Plan</legend>
    {% if message %}
        {% for msg in message %}
            <p><strong>{{ msg }}</strong></p>
        {% endfor %}
    {% endif %}
    <table>
        <tr>
            <td>Plan Name:</td>
            <td><input type="text" name="plan_name" value="{{ draft.name }}"></td>
        </tr>
        <tr>
            <td>Professor:</td>
            <td><a href="{% url 'piggy:teacher_detail' uu.id %}">{{ uu.name }}</a></td>
        </tr>
        <tr>
            <td>Description:</td>
            <td><input type="text" name="plan_description" value="{{ draft.description }}"></td>
        </tr>
    </table>
    <div>
        <button type="submit">Submit</button>
    </div>
</fieldset>
</form>
  
{% endblock content %}